home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _GUICtrlEditCanUndo.au3 < prev    next >
Text File  |  2007-09-08  |  775b  |  30 lines

  1. #include <GUIConstants.au3>
  2. #include <GuiEdit.au3>
  3.  
  4. opt('MustDeclareVars', 1)
  5.  
  6. Dim $myedit, $ret, $Status, $msg, $current
  7.  
  8. GUICreate("Edit Can Undo", 392, 254)
  9.  
  10. $myedit = GUICtrlCreateEdit("First line" & @CRLF, 176, 32, 121, 97, $ES_AUTOVSCROLL + $WS_VSCROLL)
  11.  
  12. $Status = GUICtrlCreateLabel("Nothing to Undo", 0, 234, 392, 20, BitOR($SS_SUNKEN, $SS_CENTER))
  13.  
  14. GUISetState()
  15.  
  16. ; Run the GUI until the dialog is closed
  17. While 1
  18.    $msg = GUIGetMsg()
  19.    $ret = _GUICtrlEditCanUndo ($myedit)
  20.    If ($ret <> $current) Then
  21.       If ($ret == 0) Then
  22.          GUICtrlSetData($Status, "Nothing to Undo")
  23.       Else
  24.          GUICtrlSetData($Status, "Undo Available")
  25.       EndIf
  26.       $current = $ret
  27.    EndIf
  28.    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
  29. WEnd
  30.